#include "DetourObstacleAvoidance.h"
#ifdef __cplusplus
extern "C" {
#endif
void nav_dtObstacleAvoidanceDebugData_addSample(dtObstacleAvoidanceDebugData * c_this,float const * vel,float const ssize,float const pen,float const vpen,float const vcpen,float const spen,float const tpen){
	float const * c_arg_vel=(float const *)(void*)(vel);
	float const c_arg_ssize=ssize;
	float const c_arg_pen=pen;
	float const c_arg_vpen=vpen;
	float const c_arg_vcpen=vcpen;
	float const c_arg_spen=spen;
	float const c_arg_tpen=tpen;
	c_this->addSample(c_arg_vel,c_arg_ssize,c_arg_pen,c_arg_vpen,c_arg_vcpen,c_arg_spen,c_arg_tpen);
}

void nav_dtObstacleAvoidanceDebugData_Delete(dtObstacleAvoidanceDebugData * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_dtObstacleAvoidanceDebugData_DeleteArray(dtObstacleAvoidanceDebugData * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

dtObstacleAvoidanceDebugData * nav_NewdtObstacleAvoidanceDebugData(){
	dtObstacleAvoidanceDebugData* wrap_out = new dtObstacleAvoidanceDebugData();
	return wrap_out;
}

float nav_dtObstacleAvoidanceDebugData_getSampleCollisionTimePenalty(dtObstacleAvoidanceDebugData const * c_this,int const i){
	int const c_arg_i=i;
	float c_out = c_this->getSampleCollisionTimePenalty(c_arg_i);
	float wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtObstacleAvoidanceDebugData_getSampleCount(dtObstacleAvoidanceDebugData const * c_this){
	int c_out = c_this->getSampleCount();
	int wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtObstacleAvoidanceDebugData_getSampleCurrentVelocityPenalty(dtObstacleAvoidanceDebugData const * c_this,int const i){
	int const c_arg_i=i;
	float c_out = c_this->getSampleCurrentVelocityPenalty(c_arg_i);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtObstacleAvoidanceDebugData_getSampleDesiredVelocityPenalty(dtObstacleAvoidanceDebugData const * c_this,int const i){
	int const c_arg_i=i;
	float c_out = c_this->getSampleDesiredVelocityPenalty(c_arg_i);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtObstacleAvoidanceDebugData_getSamplePenalty(dtObstacleAvoidanceDebugData const * c_this,int const i){
	int const c_arg_i=i;
	float c_out = c_this->getSamplePenalty(c_arg_i);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtObstacleAvoidanceDebugData_getSamplePreferredSidePenalty(dtObstacleAvoidanceDebugData const * c_this,int const i){
	int const c_arg_i=i;
	float c_out = c_this->getSamplePreferredSidePenalty(c_arg_i);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtObstacleAvoidanceDebugData_getSampleSize(dtObstacleAvoidanceDebugData const * c_this,int const i){
	int const c_arg_i=i;
	float c_out = c_this->getSampleSize(c_arg_i);
	float wrap_out  = (c_out);
	return wrap_out;
}

float const * nav_dtObstacleAvoidanceDebugData_getSampleVelocity(dtObstacleAvoidanceDebugData const * c_this,int const i){
	int const c_arg_i=i;
	float const * c_out = c_this->getSampleVelocity(c_arg_i);
	float const * wrap_out  = (float const *)(void*)(c_out);
	return wrap_out;
}

dtObstacleAvoidanceDebugData * nav_dtObstacleAvoidanceDebugData_IndexArray(dtObstacleAvoidanceDebugData * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

bool nav_dtObstacleAvoidanceDebugData_init(dtObstacleAvoidanceDebugData * c_this,int const maxSamples){
	int const c_arg_maxSamples=maxSamples;
	bool c_out = c_this->init(c_arg_maxSamples);
	bool wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtObstacleAvoidanceDebugData_normalizeSamples(dtObstacleAvoidanceDebugData * c_this){
	c_this->normalizeSamples();
}

void nav_dtObstacleAvoidanceDebugData_reset(dtObstacleAvoidanceDebugData * c_this){
	c_this->reset();
}

void nav_dtObstacleAvoidanceParams_Delete(dtObstacleAvoidanceParams * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_dtObstacleAvoidanceParams_DeleteArray(dtObstacleAvoidanceParams * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

dtObstacleAvoidanceParams * nav_NewdtObstacleAvoidanceParams(){
	dtObstacleAvoidanceParams* wrap_out = new dtObstacleAvoidanceParams();
	return wrap_out;
}

unsigned char * nav_dtObstacleAvoidanceParams_GetPtrToAdaptiveDepth(dtObstacleAvoidanceParams * c_this){
	return (unsigned char *)(&(c_this->adaptiveDepth));
}

unsigned char * nav_dtObstacleAvoidanceParams_GetPtrToAdaptiveDivs(dtObstacleAvoidanceParams * c_this){
	return (unsigned char *)(&(c_this->adaptiveDivs));
}

unsigned char * nav_dtObstacleAvoidanceParams_GetPtrToAdaptiveRings(dtObstacleAvoidanceParams * c_this){
	return (unsigned char *)(&(c_this->adaptiveRings));
}

unsigned char * nav_dtObstacleAvoidanceParams_GetPtrToGridSize(dtObstacleAvoidanceParams * c_this){
	return (unsigned char *)(&(c_this->gridSize));
}

float * nav_dtObstacleAvoidanceParams_GetPtrToHorizTime(dtObstacleAvoidanceParams * c_this){
	return (float *)(&(c_this->horizTime));
}

float * nav_dtObstacleAvoidanceParams_GetPtrToVelBias(dtObstacleAvoidanceParams * c_this){
	return (float *)(&(c_this->velBias));
}

float * nav_dtObstacleAvoidanceParams_GetPtrToWeightCurVel(dtObstacleAvoidanceParams * c_this){
	return (float *)(&(c_this->weightCurVel));
}

float * nav_dtObstacleAvoidanceParams_GetPtrToWeightDesVel(dtObstacleAvoidanceParams * c_this){
	return (float *)(&(c_this->weightDesVel));
}

float * nav_dtObstacleAvoidanceParams_GetPtrToWeightSide(dtObstacleAvoidanceParams * c_this){
	return (float *)(&(c_this->weightSide));
}

float * nav_dtObstacleAvoidanceParams_GetPtrToWeightToi(dtObstacleAvoidanceParams * c_this){
	return (float *)(&(c_this->weightToi));
}

dtObstacleAvoidanceParams * nav_dtObstacleAvoidanceParams_IndexArray(dtObstacleAvoidanceParams * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

void nav_dtObstacleAvoidanceQuery_addCircle(dtObstacleAvoidanceQuery * c_this,float const * pos,float const rad,float const * vel,float const * dvel){
	float const * c_arg_pos=(float const *)(void*)(pos);
	float const c_arg_rad=rad;
	float const * c_arg_vel=(float const *)(void*)(vel);
	float const * c_arg_dvel=(float const *)(void*)(dvel);
	c_this->addCircle(c_arg_pos,c_arg_rad,c_arg_vel,c_arg_dvel);
}

void nav_dtObstacleAvoidanceQuery_addSegment(dtObstacleAvoidanceQuery * c_this,float const * tmp_arg_p,float const * q){
	float const * c_arg_tmp_arg_p=(float const *)(void*)(tmp_arg_p);
	float const * c_arg_q=(float const *)(void*)(q);
	c_this->addSegment(c_arg_tmp_arg_p,c_arg_q);
}

void nav_dtObstacleAvoidanceQuery_Delete(dtObstacleAvoidanceQuery * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_dtObstacleAvoidanceQuery_DeleteArray(dtObstacleAvoidanceQuery * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

dtObstacleAvoidanceQuery * nav_NewdtObstacleAvoidanceQuery(){
	dtObstacleAvoidanceQuery* wrap_out = new dtObstacleAvoidanceQuery();
	return wrap_out;
}

dtObstacleCircle const * nav_dtObstacleAvoidanceQuery_getObstacleCircle(dtObstacleAvoidanceQuery * c_this,int const i){
	int const c_arg_i=i;
	dtObstacleCircle const * c_out = c_this->getObstacleCircle(c_arg_i);
	dtObstacleCircle const * wrap_out  = (dtObstacleCircle const *)(void*)(c_out);
	return wrap_out;
}

int nav_dtObstacleAvoidanceQuery_getObstacleCircleCount(dtObstacleAvoidanceQuery const * c_this){
	int c_out = c_this->getObstacleCircleCount();
	int wrap_out  = (c_out);
	return wrap_out;
}

dtObstacleSegment const * nav_dtObstacleAvoidanceQuery_getObstacleSegment(dtObstacleAvoidanceQuery * c_this,int const i){
	int const c_arg_i=i;
	dtObstacleSegment const * c_out = c_this->getObstacleSegment(c_arg_i);
	dtObstacleSegment const * wrap_out  = (dtObstacleSegment const *)(void*)(c_out);
	return wrap_out;
}

int nav_dtObstacleAvoidanceQuery_getObstacleSegmentCount(dtObstacleAvoidanceQuery const * c_this){
	int c_out = c_this->getObstacleSegmentCount();
	int wrap_out  = (c_out);
	return wrap_out;
}

dtObstacleAvoidanceQuery * nav_dtObstacleAvoidanceQuery_IndexArray(dtObstacleAvoidanceQuery * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

bool nav_dtObstacleAvoidanceQuery_init(dtObstacleAvoidanceQuery * c_this,int const maxCircles,int const maxSegments){
	int const c_arg_maxCircles=maxCircles;
	int const c_arg_maxSegments=maxSegments;
	bool c_out = c_this->init(c_arg_maxCircles,c_arg_maxSegments);
	bool wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtObstacleAvoidanceQuery_reset(dtObstacleAvoidanceQuery * c_this){
	c_this->reset();
}

int nav_dtObstacleAvoidanceQuery_sampleVelocityAdaptive(dtObstacleAvoidanceQuery * c_this,float const * pos,float const rad,float const vmax,float const * vel,float const * dvel,float * nvel,dtObstacleAvoidanceParams const * params,dtObstacleAvoidanceDebugData * debug){
	float const * c_arg_pos=(float const *)(void*)(pos);
	float const c_arg_rad=rad;
	float const c_arg_vmax=vmax;
	float const * c_arg_vel=(float const *)(void*)(vel);
	float const * c_arg_dvel=(float const *)(void*)(dvel);
	float * c_arg_nvel=(float *)(void*)(nvel);
	dtObstacleAvoidanceParams const * c_arg_params=(dtObstacleAvoidanceParams const *)(void*)(params);
	dtObstacleAvoidanceDebugData * c_arg_debug=(dtObstacleAvoidanceDebugData *)(void*)(debug);
	int c_out = c_this->sampleVelocityAdaptive(c_arg_pos,c_arg_rad,c_arg_vmax,c_arg_vel,c_arg_dvel,c_arg_nvel,c_arg_params,c_arg_debug);
	int wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtObstacleAvoidanceQuery_sampleVelocityGrid(dtObstacleAvoidanceQuery * c_this,float const * pos,float const rad,float const vmax,float const * vel,float const * dvel,float * nvel,dtObstacleAvoidanceParams const * params,dtObstacleAvoidanceDebugData * debug){
	float const * c_arg_pos=(float const *)(void*)(pos);
	float const c_arg_rad=rad;
	float const c_arg_vmax=vmax;
	float const * c_arg_vel=(float const *)(void*)(vel);
	float const * c_arg_dvel=(float const *)(void*)(dvel);
	float * c_arg_nvel=(float *)(void*)(nvel);
	dtObstacleAvoidanceParams const * c_arg_params=(dtObstacleAvoidanceParams const *)(void*)(params);
	dtObstacleAvoidanceDebugData * c_arg_debug=(dtObstacleAvoidanceDebugData *)(void*)(debug);
	int c_out = c_this->sampleVelocityGrid(c_arg_pos,c_arg_rad,c_arg_vmax,c_arg_vel,c_arg_dvel,c_arg_nvel,c_arg_params,c_arg_debug);
	int wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtObstacleCircle_Delete(dtObstacleCircle * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_dtObstacleCircle_DeleteArray(dtObstacleCircle * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

dtObstacleCircle * nav_NewdtObstacleCircle(){
	dtObstacleCircle* wrap_out = new dtObstacleCircle();
	return wrap_out;
}

float(*nav_dtObstacleCircle_GetPtrToDp(dtObstacleCircle * c_this))[3]{
	return (float(*)[3])(&(c_this->dp));
}

float(*nav_dtObstacleCircle_GetPtrToDvel(dtObstacleCircle * c_this))[3]{
	return (float(*)[3])(&(c_this->dvel));
}

float(*nav_dtObstacleCircle_GetPtrToNp(dtObstacleCircle * c_this))[3]{
	return (float(*)[3])(&(c_this->np));
}

float(*nav_dtObstacleCircle_GetPtrToP(dtObstacleCircle * c_this))[3]{
	return (float(*)[3])(&(c_this->p));
}

float * nav_dtObstacleCircle_GetPtrToRad(dtObstacleCircle * c_this){
	return (float *)(&(c_this->rad));
}

float(*nav_dtObstacleCircle_GetPtrToVel(dtObstacleCircle * c_this))[3]{
	return (float(*)[3])(&(c_this->vel));
}

dtObstacleCircle * nav_dtObstacleCircle_IndexArray(dtObstacleCircle * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

void nav_dtObstacleSegment_Delete(dtObstacleSegment * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_dtObstacleSegment_DeleteArray(dtObstacleSegment * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

dtObstacleSegment * nav_NewdtObstacleSegment(){
	dtObstacleSegment* wrap_out = new dtObstacleSegment();
	return wrap_out;
}

float(*nav_dtObstacleSegment_GetPtrToP(dtObstacleSegment * c_this))[3]{
	return (float(*)[3])(&(c_this->p));
}

float(*nav_dtObstacleSegment_GetPtrToQ(dtObstacleSegment * c_this))[3]{
	return (float(*)[3])(&(c_this->q));
}

bool * nav_dtObstacleSegment_GetPtrToTouch(dtObstacleSegment * c_this){
	return (bool *)(&(c_this->touch));
}

dtObstacleSegment * nav_dtObstacleSegment_IndexArray(dtObstacleSegment * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

dtObstacleAvoidanceDebugData * nav_dtAllocObstacleAvoidanceDebugData(){
	dtObstacleAvoidanceDebugData * c_out = dtAllocObstacleAvoidanceDebugData();
	dtObstacleAvoidanceDebugData * wrap_out  = (dtObstacleAvoidanceDebugData *)(void*)(c_out);
	return wrap_out;
}

dtObstacleAvoidanceQuery * nav_dtAllocObstacleAvoidanceQuery(){
	dtObstacleAvoidanceQuery * c_out = dtAllocObstacleAvoidanceQuery();
	dtObstacleAvoidanceQuery * wrap_out  = (dtObstacleAvoidanceQuery *)(void*)(c_out);
	return wrap_out;
}

void nav_dtFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData * ptr){
	dtObstacleAvoidanceDebugData * c_arg_ptr=(dtObstacleAvoidanceDebugData *)(void*)(ptr);
	dtFreeObstacleAvoidanceDebugData(c_arg_ptr);
}

void nav_dtFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery * ptr){
	dtObstacleAvoidanceQuery * c_arg_ptr=(dtObstacleAvoidanceQuery *)(void*)(ptr);
	dtFreeObstacleAvoidanceQuery(c_arg_ptr);
}

dtObstacleAvoidanceDebugData * nav_NewDtObstacleAvoidanceDebugDataPtrArray(long n){
	dtObstacleAvoidanceDebugData* c_this=new dtObstacleAvoidanceDebugData[n];
	return c_this;
}

dtObstacleAvoidanceParams * nav_NewDtObstacleAvoidanceParamsPtrArray(long n){
	dtObstacleAvoidanceParams* c_this=new dtObstacleAvoidanceParams[n];
	return c_this;
}

dtObstacleAvoidanceQuery * nav_NewDtObstacleAvoidanceQueryPtrArray(long n){
	dtObstacleAvoidanceQuery* c_this=new dtObstacleAvoidanceQuery[n];
	return c_this;
}

dtObstacleCircle * nav_NewDtObstacleCirclePtrArray(long n){
	dtObstacleCircle* c_this=new dtObstacleCircle[n];
	return c_this;
}

dtObstacleSegment * nav_NewDtObstacleSegmentPtrArray(long n){
	dtObstacleSegment* c_this=new dtObstacleSegment[n];
	return c_this;
}

#ifdef __cplusplus
}
#endif
